/* 
 * Gneat (http://gneat.org)
 *
 * (C) Copyright 2011 and beyond - Claudio Stella, all rights reserved.
 *
 * This file is part of Gneat.
 *
 * Gneat is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License (LGPL)
 * as published by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Gneat is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * and the GNU General Public License, for completeness, along with Gneat.  
 * If not, see <http://www.gnu.org/licenses/>.
 */
package org.neatshell.gneat.client.event.live.mouse;

import org.neatshell.gneat.client.event.mouse.IMouseOutEvent;
import org.neatshell.gneat.client.handler.mouse.MouseOutHandler;

import com.google.gwt.event.dom.client.DomEvent;

/**
 * Represents a native mouseOut event.
 */
public class MouseOutEvent extends MouseEvent<MouseOutHandler> implements IMouseOutEvent {
	/**
	 * Event type for mouseOut events. Represents the meta-data associated with
	 * this event.
	 */
	private static final Type<MouseOutHandler> TYPE = new Type<MouseOutHandler>(
			NAME, new MouseOutEvent());

	/**
	 * Gets the event type associated with mouseOut events.
	 * 
	 * @return the handler type
	 */
	public static Type<MouseOutHandler> getType() {
		return TYPE;
	}

	/**
	 * Protected constructor, use
	 * {@link DomEvent#fireNativeEvent(com.google.gwt.dom.client.NativeEvent, com.google.gwt.event.shared.HasHandlers)}
	 * to fire mouseOut events.
	 */
	protected MouseOutEvent() {}

	@Override
	public Type<MouseOutHandler> getAssociatedType() {
		return TYPE;
	}
	
	@Override
	protected void dispatch(MouseOutHandler handler) {
		handler.onMouseOut(this, handler.current());
	}
}